Add VersionSlice() function.

This is to make the API somewhat compatible with the "ruby-magic" Ruby gem.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>