Engine: reimplemented global variables array as hash map

This trashes the wicked pseudo-vector and in-place binary search, and replaces them with std::unordered_map