Cleanup: Ensure that save_version_function is actually a function

This also improves readability.
Cleanup: Import just what we need
Cleanup: Fix import order