src/util: Fix from_utf8 to properly null terminate
tests/util: Fix substitute_file test cases with properly substituted expectations
substitute_file: Completed implementation