Remove faulty foldr implementation
Implemented rest of the operations, added unit tests, cleaned up code in general