Some more refactoring, adding documentation.
Merge pull request #1 from burzum/develop

Some more refactoring, adding documentation.