Everton have completed the signing of their former forward James McFadden, the club have confirmed.