core, brain like module of lpms
demandimport module, borrowed from mercurial
numerous changes to comply with new parts of lpms