refactor javascript

remove deprecated jq()
add delegated event handlers