Introduce MemoryPolicy API

Part 1 of #438 
Can be for-each loop.