Merge pull request #1 from josephfung/master

Merging in my initial refactoring. Upped the version number to 0.5