(PDB-518) Fixing storeconfig exports containing arrays

This contains the commit from https://github.com/puppetlabs/puppetdb/pull/891 and adds some rspec tests.