Joetaylor/add defs

@eventualbuddha Let me know any changes you'd like.
Does this mess up source maps?