Commit external process handling and main loop.

Sorry for such a huge block commit; one of our team is having problems
getting commits to work from his computer.