Replaced trim function with inline regex. Added encoding to slurp. Using utf8 in test file to fix tests.