shell: write newline on EOS
Improve container API and add more tests