Code cleanup
Improved documentation
Fixed licenses