Refactored out heap struct to its own file.