Add more tests and docs for registering plugins.