Cleanup code

* Move Lock, Unlock & Getuid under snapshot
* Consistent method structuring
* Improve inline documentation
* Add missign tests
Add docmentation & license