Reimplemented logger.c and fixed build system