Fix a couple of bugs.

register_plugin takes only the class. Use imp to load instead of relying on __import__.