Adds tests, cleans up sample.