port $.js to plain javascript
AMD version of stuff