Much server stuff added, database structure begun on remote.
Fixing split by unifying loop-exit and database branches