Added logging system. Fixes #8