Implementation of binary heaps data structure in pure Lua