better prelogin error handling
refactoring and more testing
correctly handle unknown and invalid tds versions, more testing