Modified code to run on Oracle and PostgreSQL. Moved AchillesHeel analysis into Achilles SQL.