Move wrapper function out of primary file.
Fix bug. nativetent-post fails if there's no app.

If there isn't an app and nativetent tries to create on there will be an
error when it displays the prompt to accept the 'code' value from the user.

This is because the original JSON post will still be waiting to be piped
into stdin and will take the place of the code.