first pass at main table

also made the debug mode work better, fixed a hanging bug (error
handling) and introduced a commands' log