Re-structured code into three separate scripts, commented utilities and main scripts. Added .gitignore.