add generate and compile tests, fixes #2 & fixes #3