Scala Tweaks

Some cleanup from Erik, unit test fixes, adding license headers.