Finished static_inversion.py refactoring.