Adding log function, some tests, directory automatic creation...