added possibility to purge old jobs from DB, added state attribute for jobs