Facebook improvements from https://github.com/fikus, manual merge
Add docs