TODO: continue translating serpent code (in comments in allegro_test.cpp) to C++ and running tests.