Refactoring and slight change to authentication sequence.

Refactors the authentication sequence so each step is in a seperate
function.  This cleans up the main loop and means we can remove the gotos.

The command (unlock or lock) is now sent from the phone as soon as the BT module
connects.  This way, as soon as the door receives a good MI challenge response,
it can execute the command without any more communications with the phone.