simplified/cleanedup sample app
added typescript so that sourcemaps work in lib files; fixed chat so messages are handled in both directions