Added some network funcitonality, more extensive tests.