Parser now throws exceptions instead of exiting.

Previously the parser was assuming it was running on the command line
and exiting when it encountered an expected construct in the file.
Refactored it to throw unchecked exceptions instead.
Move example handlers to an examples package.

Fixes #4