Spawn extraction

- command and macro functions are extracted to separate classes.
- some logging and js improvements
- a json fix for JobAlert