Move the main loop out into the libobt