Binary heap implementation in pure Lua
