Merge pull request #13 from snakevil/master

Unit-tested for applications.