Add basic unit tests and improve compilation support

Automated unit tests help to keep the code stable, and unsafe use of this is removed from latest LZString version to enable functional programming and compiling it with Closure compiler advanced optimizations. Also contains one simple bug fix.