Github uses markdown :)
- Added rudimentary documentation
- Fixed functionality to be more robust
- Exported the API functions