Added scaladoc and tests