Fix/enhance/standardise: Node pollution, strict mode uglify/detect environment global context

Made changes to detect the global context of the environment #1179
Made changes to run in strict mode #1179
Made changes and added a config file to allow option not to pollute Node environment #1214
Standardise double quotes (") to single quotes (') which were most extensive in library
Reverse strict comparisons of typeof statements to prevent accidental assignments
Standardised undefined checks to use typeof strict comparisons