As marvelous as the Haunted House series may be, there is a certain plot hole I can't get out of my head. Who gave William the Thin his time-machine and for what reason did he give it to him?

When he introduces it in Part One, he explains that this time-machine, disguised as a pocket watch, was given to him as a birthday present from a complete stranger. Firstly, who is this stranger? And secondly, if he had never met him before in his life, for what possible reason would he trust him with a time-machine?

Another thing on my mind was, is this pocket watch a scientific invention, or is it a work of magic? if that could be answered, it may possibly help us to discover who this stranger is, whether he's a genius scientist or a wizard.