Allow trailing ';' and add some testcases for it

All trailing ';' will be removed from the output.
Right-hand-side expressions containing multiple ';' to
separate javascript statements will not be removed.