Order HABTM tables using both ids

I've been using yaml_db for backups in git and to generate seed data, and this patch has been really useful to avoid a lot of noise from reorderer rows in join tables. It just assumes that if the first column is the first and second columns end with `_id`, it's a join table and uses the second column in the ordering. If they don't, it's harmless.