Modularise

(Almost) all modules may now safely be instantiated more than once (the
exception being stdin). This is achieved through using a 'data'
structure that allows having separate data for each instance, rather
than storing them in static variables.