HanziDecomposer refactoring plus two unit tests

I've used the new `ifComponentExists` function to refactor a bit the hanzidecomposer.js file. Also I added some tests.