Porting tubular.jquery.js and modifiy for better use