Bugfix and implementation of _ID column

Fixing issue that the foreign key id has to have the same name as the id of the model. Fixing #188 and possibly #212 and #127