Refactor more listeners, fix some bugs, formatting fixes

Added check to processConfig to prevent it from trying to parse event data
when function is called from click handler (instead of having textfile passed to it).