lots of bugfixes; cleaned up twserver/twclient and connection; new inputvalidation file