Issue660: port remaining JSMin fixes

Hi,

I've finally found some time to finish #151 (sorry for the delay, holidays got in the way).

I've organized the history a bit differently (some fixes didn't compile in Java because of unreachable code, and were fixed in subsequent commits!). I've added links in the logs to make it clear what comes from where.

The hardest part was to find out what each commit did and write a unit test for it (some are weird corner cases).  Your example from last time now works.