Updated documentation and some minor API changes.