Code as of 3am

A few gui fixes, as well as locks and threads added.