Improved documentation. Closes #341