Improve jQuery definitions, make compatible with TS 0.9