Fix bug when passing arrays as arguments
Use module pattern
Add monoid and semigroup classes