clickscript points to new db, cleanup code for interrupted agg archival

cleanup code is not tested yet (started the code while long running
cleanup queries were taking a long time)