Added chroot API function.

Also updated the documentation.