chore(made dist and wdist into functions)

Closes #39
Only parse args when executing as a script