stripping out foreign keys and unused tables.
cleanup