Refactor and rename a few functions
README: Define min-heaps as an example.