Added DataStream classes.

Will be used in the future as a faster way of generating XML/JSON
responses.
Improved how public and private indices are accessed.

Also started implementing a pluggable AuthSystem to interface with
different authentication systems.