use amd only if needed

change the order so that if you are using requirejs you can still insert jquery without it