Introduce MemoryPolicy API

Part 1 of #438 
This is really ugly. Break into two lines