plugin: extract two free functions from PluginStateStorage

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
plugin: todo added

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
plugin: add documentation for PluginStateStorage class

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
plugin: extract PluginStateManager class

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>