Clean up mcal gpt implementations. Add countof utility.