Small patches related to new sync states, fix in lastSuccessfulSyncTime and Qt5 port. Added tools directory with a tool to generate a plugin template given inputs in a config file.

The tool will be useful for plugin developers to generate template for a plugin given the inputs in a config file. Using this tool, the plug-in developer can just concentrate on the core sync functionality