Fix sed.

Before, options in sed had to come in the order 'gim', otherwise they
would fail.  This has expanded it to accept any string as options, since
accepting only zero or one of gim in any order is a painful regex.