some refactoring, fixed nasty bug in item_swap, finished heap implementation, I guess most of the code is almost bugfree