A seemingly working implementation of A*.