Added unittests for gpcbasis functions and fixed a few bugs