Add unit tests for utils and refactor Makefiles

1. Add unit tests for utils;
2. Put the common code shared by app and utest into a library, and link the
library to app and utest.
This eliminates the duplicated compiled objects.
3. Update .gitignore

Change-Id: I05ee93c2b23748a1e038eeec3534d49b94911366
Signed-off-by: Lei YU <mine260309@gmail.com>
4 files changed