Lost of changes

Reorg the files, especially the state machine sources.  Also, fixed the freakin ADO.NET bug - you MUST have a primary key on all tables, probably when inserting new items with foriegn keys