Add documentation

Adding some documentation, re-arranging some classes into modules.