Run tests with warnings on, and fix some warnings
Refactor execfile to avoid imp to avoid deprecation warnings