Initial Port from Groovy to Scala.  It's not that pretty but it's a start