updates

* declaration syntax from function x(){} to var x=function(){}
* added optional "doc" parameter, which defaults to "document"
* re-enabled support for arbitrary tag attributes;
  this had been commented out
* always returns the DOM element(s) created;
  original version did not do so when an "id" was used to append them into the DOM