fixed tests
Added some html to allow running the tests in a browser, for easier debugging
A few improvements

 * Precendence to named arguments, these are checked before anything else
now.
 * Required arguments are given precendence over optional arguments.

This is for #5, #7, #9