Make the access to register() synchronized

Otherwise, executing register on multiple threads can cause for things to get messy...
Turn registration map into mutable synchronized map
Merge pull request #10 from NeQuissimus/ConcurrentRegistration

Make the access to register() synchronized