Made JS library wrapper optional

Its useful not to be restricted to using either jquery or mootools.
The changes are should be fully backwards compatible.