Updated connection timeouts for DB and overhauled code to fit new system