Some API changes

And starting to add support for more document formats