Refactored jquery.caret.js