Write cjr_get_ending function, adjust return value of cjr_get_stem
I really need to test these functions.