Issue #100: some refactoring related to DEBUG_ONLY_FEATURES

Verified that app and unit tests run correctly if this flag is false.