Moved to Template Haskell on some Functions.  It's still a mess but it's better than it was before