Pluggable serializer for data output formats

Here is a pull request that fixes #15. Or at least starts to, it's just a reimplementation of the current format using an external serializer.

@philsturgeon Let me know if this is a good direction, or if you have comments, and I can implement a few other serializers...