Rmg

Merged jfhs's patch with current engine, without much investigation. Hopefully it's compatible with smart pointer usage and recent random number generator changes.

However, random map at this point won't even launch, showing bug in a very unexpected point of engine.
It's not aimes for merge, just a branch to develop RMG further.