Basic callback registering, some threading related stuff