Robustification and unit tests.

Now handles calling destroy() and register() from all kinds
of strange places.

Updated javadoc. No longer apologizing for "redundant" calls
to onLoad(). They're a feature.