Rewrite to use the new ExternalValue machinery.

Also take the opportunity to have somewhat useful error messages.

Requires a major version bump, as the unsafe lib interface has changed
yet again. The new style will hopefully be more forward compatible
though...
Update README to new interface