Wiped out MIL stuff
fixed some of Adam's manual queries so they work on all databases
added support for Postgres