moved constructor methods to prototype, added heap.js