Adds output arguments to code directive and refactors code mode parsing a little