Factor out 'higher' abstract algebraic structures from prelude to base

There are still instances of Semigroup and Monoid from within the
Prelude. These are very natural and so we leave a very limited
abstract algebraic type class implementation for these in the Prelude.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>