A slight refactor to the RTE code; more abstraction and code into XMLFast.

Fix bug in xml/json/tab handling (from upstream change in what the "tab"
format argument does).

Also, unit tests from local staging of some of these operations.

Fixes #122.