Add all various improvements in scala.

Merged various forks to include as many as possible improvements made to goose in the main trunk.