Make is_safe_mode_available() testable and add some unit tests
Merge branch 'master' of github.com:humanmade/hm-backup