Made changes to SQL code: fixed some problems in Postgres and Oracle for exportToJSon, fixed achilles SQL so only selected analysisIds are run.