[fix] proper variable name and move pacakage logic, #28

Errors in the JSON of package.json would crash solenoid due to incorrect variable reference

I shifted the package logic to the readPackageJSON function as it makes more sense and can be shortened alot.