Added slice conversion functions. Closes issue #4.