Initial import of the scala implementation
Added new stuff.