Suppose you are right there. The functions are a bit on the expensive side, could do without the range checks & multiplication. They might not perform so well in long loops. Though I learned a lot while working on them, I can refer to them while implementing optimized code.
The performance increase I noticed is with loading. I had several large arrays for map data, I was able to consolidate them into a single array. Which caused a considerable decrease in loading/setup time.
Just noticed I left a few "asdf" loop indexes in there.