Tail-call-optimised fibonacci function implemented.