Add more documentation and tweak exports.