Return Alert cont + code cleanup

More integration and cleaning of code. Deprecated fields in a number of
tables have been removed, to be replaced at a later date. SQL has been
edited to deal with this.