Use "attach" for consistency
Remove commented-out code

See #719
Refactor: rename method
Minor: use ⇒
Refactor
Fix #1113 "Setting datatype from Schema with namespace fails"

- also move schema-related code to Scala