Tweak layout.

- Use enums instead of defines for config types.
- Cleanup mem_pool.h
- Refactor dir_db_log_insert() function.