delete key at last position in documnet

This prevents the Delete key at the end of the last line from moving cursor outside of element and cause Rangy error. See also last commit.