Moved tornado application setup into main to support console scripts entry point