LMMS Memory Manager

See post on mailing list for details.

Testing appreciated before merging.