added support for amd, removed jquery dependency