Multiple updates, see description...

- Refactored some code so its better Go code
- Added code to fix issue #5
- Added code to fix issue #14