Added .gitignore file to ignore emacs temp files.

Also modified the isCM and helper methods to eliminate the last variable; I checked all partitions (p,q,r) with p, q, r <= 5, and it is consistent with the old isCM method.