changed optional argument syntax of \img command (img.js extension) to be more LaTeX-like

Optional arguments are now given either as 

    \img[valign=<valign>,width=<width>,height=<height>]{URL}

or

    \img[<valign>][<width>][<height>]{URL}

which are both common ways to supply optional parameters in LaTeX (the latter is usually used when there is just one optional argument). Example in http://jsfiddle.net/c6sy534g/ 
Note that this will allow you to specify things like `toString` and `constructor` as parameters, since `key in def` will be true for any built-in function as well as the three properties that you include.  Perhaps `def.hasOwnProperty(key)` would be better.