foreign keys, more efficient

- npm test time decreased from 5s to 1.5s
- re-wrote sql queries to be cleaner and faster
- resolve referenced_column and referenced_table
0.12.0