pulled sql create out to file, cleaned up a lot of old, useless code, added db handle validation