Bug fixes

* optimise URL repairs: don't replace "[", "]", ":" in host names, allowing IP address literals (closes #98)
* SyncManager: minor refactoring