Giant rewrite.
Added some Network parts.