Added memory manager for pinned memory

* Allocates, resuses and destroys pinned memory
* Added dummy static class to call garbage collection at the end of the program
Using pinned memory in imageio
Changed API for iota

* Using -1 as rep to deal with no reps
* Simplified API
* Doesn't break existing API
BUGFIX Fixed index-based array operators

* Was not getting proper dimensions.
Merge pull request #257 from shehzan10/devel

Pinned memory manager