Implemented support for login and passcode headers (fixes #4).
Added default host to localhost in connect subroutine.