Change regex search for role search, when constructing dot.
Bug fixes. Tests added. Unregister and off methods added.