Added end-to-end IPv6 test and refactoring.