Some code cleanup for #6, changed the command parsing (should be easier to understand now) and logging for #5