Support slices of all the types otherwise supported

This moves parsing of the value into a separate method, so that it can
be used both for slices and normal values.
Merge pull request #2 from trygveaa/slice-all-types

Support slices of all the types otherwise supported