Add minor checks to PG-PuReMD and PuReMD. Major refactoring of sPuReMD: backport much of PuReMD code and add CUSTOM geo format.