Initial commit for release 1.1 dev branch, started commenting and fixing bugs.