This episode takes place in May 1891 and May 2103.
Sherlock is more brilliant that most give him credit for, given he came from a time before electricity. Having easily absorbed all relevant knowledge of the modern world within an afternoon.
Lestrade's family holding onto Watson's journals implies John Watson couldn't stand to keep the memoirs of Sherlock around; unaware he survived and became a bee keeper
The Doctor who restored Sherlock was based on Conan Doyle in appearance.
The compudroid likely came to the conclusion that it was best to study and then emulate John Watson's personality from the memoirs, in order to be the best fitting assistant to Sherlock Holmes. Given the man will have unorthodox planning and thinking compared to a Scotland Yard officer.