general fixes

- generated json is now valid for copy/paste
- better control of using custom symbols for expand/collapse
- some refactoring
Made everything static, so no instance is needed in order to use it

this fixes the problem that the variable name was used to deal with onclick events, which sucked