Database code cleanup!

Removed a LOT of obsolete code and unnecesary comments