Started refactor of code

Breaking up code to be more functional and adding a few more features.
Re-minified
Merge pull request #22 from coop182/refactor

Refactor