Generated the internal database diagram and fixed up some internal naming inconsistencies.