Update plugin architecture and support deploy plugins.

* Add more logic to rsync module.