Pinned memory manager

* Added memory manager for pinned memory
* Using pinned memory in image io
* Changed API for iota. More simplified. Doesn't break existing API.