fixing version check

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
use template also for the main storage config

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
refactoring and starting to add tests

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>