Database tidy up script, Work in Progress.