Add test, simplify Main
Get shell out of lib, add test, refactor