add sign-in and sign-out functionality

page 363 end of section 8.2 with tests passing