Fixed cursor handling and swallowing of empty lines.
Added optional http basic auth.