rename all the constants marking ending from _MAX to _ENDING. this also updates Java/Python/Ocaml bindings accordingly