Code Cleanup: Startup and recursion cleanup

Remove recursion from DB stealing routine, change application startup
to proper Python structure.