Support AsJava/AsScala

Closes #4 finally