make_sync no longer swallows exceptions.

This prompted a major refactor, so it's all good. It's hopefully a lot
more understandable now!
Add tests for make_sync.

Run with `trial test/sync.py'.