Refactored and added more tests.Cleaned up netlink a bit.

I've added more tests and refactored and reorganized the codebase a bit.