Motor driver

This branch is ready to be merged into master. I have not kept up with master, so let's see how well this works :-)