Support v2 API

To be released as 0.4.0. I believe this change set will resolve the issues raised in #10, #11 and #13.