Fix has many relationships.

Closes https://github.com/ChicagoBoss/boss_db/issues/166
An attempt to make dialyzer happy.

It still reports an error with has_many_forms though.
Dialyzer is now happy, correct tree type is emitted depending on the type.
Merge pull request #167 from davidw/has_many_fix

Fix has many relationships.