Merge pull request #78 from marcoscaceres/master

Refactored some code, added docs, moved things around, cleaned up