yak shaving: separate out local functions and add p- function.
added dummy typed macros for cljs to avoid unreadable #+clj(s) littering the code.