Refactoring, moved some classes from root namespace to modules.
Added header docs.