Added unit tests for new misc_math functions.
Fixed target Makefiles to support code refactor, which has the nice effect
of make all_fw compiling.
Fixed simulation boolean defines.
Fix unit tests.