Merge pull request #6 from marineam/tests

Tests and bugfixes for cgpt next