Refactor slice and fix iterator_traits specialization

- Refactor slice to be a little easier to read.

- Move std::iterator_traits specializations into namespace std to fix compilation.

Tests passed. Compiled with g++-4.8.2 and Clang-3.4-SVN