Rearrange code base, make plugins into classes.

- Added toposort for plugin dependencies
- If dependency fails to load then plugin is disabled.
- Added command plugin (no configuration at the moment)