Changed a buttload. Mainly client stuff. Pay attention to XXX and TODO's.