Cleaned up and reorganized some frogatto code.