Preliminary IPv6 support.

Very little difference between the two. Had to modify more lines for the
test than I had to to implement the function.

TODO - Add more testing for IPv6.