Add license
Small formatting tweaks
Hoist some functions out
Merge pull request #1 from micahr/master

Really basic formatting tweaks