Add shebang and CLI mode check

Not actually needed, but useful.