Factorized blocks that generated main().
"-D fdb-ci" can now be used in flash to redirect output to trace and return test status.
Adding flash CI for Travis.