Formula One champion Lewis Hamilton has ended months of stalling and deliberation by finally signing a new contract with Mercedes.