copy of Data.Monoid.Ord

from http://hackage.haskell.org/package/monoids-0.3.2

I prefer to copy this module instead of adding monoids as a dependency
because (1) the monoids package is deprecated and its successor looks
much more complicated, and (2) monoids depends on other random stuff
like fingertrees because it defines monoids for everything.
remove references to Reducer

I don't need that part of the monoids package, just the Ord instance for
Min.
Location, Located

In order to figure out where to divide the HaskellSource, I need to know
where each section begins. haskell-src-exts already stores this
information, but accessing it is cumbersome. Location makes it easier to
extract the SrcLoc, and Located remembers the earliest location
encountered during a particular computation.
refactor to Language.Haskell.Exts.Location
remove unused imports
Location instance for Maybe

Locations are optional, so it if there is no value from which to obtain
a location, that's fine.
refactor to functions

We now extract location information, then prompty discard it (for now).
simpler record construction via RecordWildCards
remove unused imports
fix some warnings
testM is only used to testing
don't throw away the location info
split source according to line numbers

For now, it only works when the prelude has no module declaration nor
any function definitions. The default prelude satisfies those stringent
requirements.
test first: a prelude with function definitions

tests/preludes/readme/prelude.hs has function definitions,
and they are not separated properly.
separate function declarations
test first: a prelude with a module name

tests/preludes/modulename/prelude.hs has a module name,
and it isn't separated properly.