Fix sed commands to work on OS X

\s as an alias for [[:space:]] doesn't work on OS X Mavericks.
putting it into extended mode (-E) isn't compatible with GNU sed, and
doesn't fix the problem.

Test suite fails on OS X before this change, now passes.