Novak Djokovic and Serena Williams, each bidding for a seventh Australian Open title, were handed tricky first-round matches in Melbourne.