Unit tests

A method for unit tests. Will need to merge your "sample applications" into this.