refactor type generation to support partial views of models

- generate structural types instead of case classes,
  so that we can support partial views that are interchangable
  when their types are equivalent
- remove unnecessary sorting of fields in scala
- use full package names where possible in scala
- reduce blank lines in generated code