Refactored emission calculations
WIP: refactoring
WIP: clearing of caches
Bugfixes to new cache
PEP8