Typeclasses out of the core.

Fixes #129