This is a great open source controller;
http://www.diyelectriccar.com/forums/showthread.php/another-homebrew-ac-controller-45909.html
I don't know the status of Leaf motor support but it's worth asking
This is a great open source controller;So can the leaf motor be used in a DIY build mounted to the cars own gearbox using a third party controller.