Unhardcode the paths in tests and only called Socket where we need it
Socket should now only be required where it is needed