Upgrade to command based

Since php long running processes may lose connection to database or mess up the memory. This will run jobs as separate console commands.