Fixed issue with early binding, replaced delegate and bind with on

This fixes the 'double click' problem, and updates the code slightly for current jquery best standards, using .on() in place of .bind() and .delegate().