first real try at return types to scala

- fix bug in gem generator found by ref API
- clean up reference api scalatest code som