Add Python 2.x support and optimize DOM.select function to run 2-3x faster