Despite following Steve's excellent description above I still had a helluva job getting it back in place, so with some trepidation please allow my ha'porth to add to that of The Master.
I kept jamming the motor at awkward angles till I lashed the top hose back as shown in the pic below which not only gave more room but much greater visibility. There is also a 5mm projecting peg shown round about there which will hold the motor in place while you thread in the bolt.
The top bolt poses problems for it is impossible to see the hole it goes in and you have to keep it captive in the earth lead while you feed in the very long extension socket bar (13mm). My solution was to buy a retractable claw pick up from
ToolStation. Once I had this it was a piece of cake as you can hold the bolt horizontal while you engage the socket.