Generate JS functions from DOM elements

In addition to generating macros for DOM elements, we should also generate
functions that can be used at runtime (similar to Om). Not sure why/how this was
left out in original release.

Fixes #64 

/cc @cpetzold