src/cod: A few fixes

1. Log rehashing issues better
2. Change SID generation method
3. Log all module loads better
modules: Fix some rehash errors
cod: Clean up pyc files before launch
cod: Fix logic for pyc cleanup