Now 58 of 60 tests passing; ready to hook up higher-level logic in refactored module