Nicer errors when pushing belongsTo/hasMany with invalid values

Me and @sly7-7 have been working on the same issue (#2367) and after discussing on IRC I'm creating a PR too. The major difference is asserts instead of throwing errors and takes care of both belongsTo and hasMany.

May the best PR win :)