Started error handling
Rewrote timeout handling.

Finished basic error handling.
Basic framework complete.