don't hardcode maximum angle
simplify setting xLast, yLast
better dom lib detection
drop khtml prefix