Fixed authentication for addpts by adding a higher order function 'authenticated' which takes a nick and a function which executes on auth success and one which executes on auth fail.