Add is_var/1 for use in typespec guards

Allows you to specify a variable without any type contraints.
Move typespec guards to end of spec

Moves precedence of `when` to be lower than `::`.
Merge pull request #1868 from ericmj/typespecs

Add is_var/1 to typespecs and move guards to end of spec