Defending Masters champion Mark Selby edged out a battling Mark Davis 6-5 in his opening round match at Alexandra Palace.