Refactored the file loading and decoding logic to make it easier to
match our desired fall-through logic as described in the method comments.