[core] Extract `RUNTIME_ENVIRONMENT` parsing logic into a function.
[core] Extract `RUNTIME_ENVIRONMENT` parsing logic into a function.

This is a method-extraction refactoring which pulls out the logic needed
to parse `RUNTIME_ENVIRONMENT` metafiles.

(Note: this is used for a future change that also needs this logic).

Signed-off-by: Fletcher Nichol <77a0fd9e8048bbacd11af4e957bc6ff03b549f49@nichol.ca>

rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat