Remove use of deprecated APIs

Also, add a spec.
It waits for the welcome buffer to be opened, so that we can either assert about its content, or close it.