adds macros and refines pendulum example
rearranges some files
Merge pull request #1 from aleeper/master

Refines example, edits some macros.