src: make backwards compatible with v0.10

Apply some macro magic to make the module compile with both v0.10 and
v0.11.  It doesn't look pretty but it's fairly unobtrusive.  This also
spells the end of the v0.10 branch.

Fixes #28.