Bender contributions

Here are the patches from the Bender project. Ideally someone would check the patches to make sure they build and run before merging the pull request.