some experimental code to start with
added a cabal, did some restructuring
slight generalisation
added an experimental module for calculations modulo (possibly rational) numbers