Add Gemfile
Add some tests
Avoid calling shell
Find more appropriate place for at_exit handler