closes #808 Also fixes some minor issues in code style and unit tests.
closes #629 Also make minor improvements into the PhoneCat tutorial