Preserve comments in stored procedure code.

The point of this pull request is to alter the autopatcher to preserve comments in stored procedures when they are applied as patches (rather than postpatches).

In the process, a number of other items were addressed, most of which could be included in TacitKnowledge's version. Each of the commits focuses on a specific issue (like compilation using java 7 or removing deprecation warnings). It may be easier to review each commit individually.