Replace MicroJob Generation code with Query to database

Must run bootstrap first before it works