Refactoring package.json reading into it's own file

In preparation for re-using it in appconfig generation.