MIT licensed
Use real logging
Better management of globals