performance improvement

Uses HTML tree traversal, rather than jQuery.
Merge branch 'dev'