Fix build dependencies to not compile flags/*.c when executing all target.
WIP: Add tests for event module.