Basic http auth support added. Some other modifications done