Improved two-pass encoding

The first pass now uses -an no matter what and also outputs to NUL