Moving files from src to root to accommodate npm require paths
Also check for the existence of globals before using them
Add npm package file