Improved trim() and added tests for -Ofun

There actually was an error in my trim(),
and doing /^\s+(.*)\s+$/$1/ is not right either.
Tests prove it :)