More shebang fixes

This fixes an error we're seeing on GitHub for an empty shebang with whitespace (`#! [space]`), adds a few more test cases, and some docs to the shebang code.