Optimized ndfsm handling to stop processing inputs when there are no more live branches; added a trace-automata parameter to control printing trace info to stdout