Improved documentation, added license, general structure refactoring