Cofactor 20141118

More tests and bug fixes, demo script and Dockerfile