Organized code-base for better visibility. Added minified version of the script.