Added licence info
Scaladoc and some performance improvements