moved session code into its own subpkg. Made newline chars kept at end of lines and updated tests to boot