Fix edge case where parameters passed incorrectly to editor

Also,

  * Add missing copyright header to wemax.
  * Remove dead code from emax.
  * Add comments where appropriate.