Rename MemoryManager::swapWith() to swap() and match the semantics

* So it has the same signature as usual std types for in-class swapping functions.
* Move the definition nearer the members definition so
  it is less likely to forget to update it when changing the members.
* Add an assert() to document the fact we expect them to use the same VM.
* std::swap can handle a static array in C++11.