West Ham have completed the signing of Manchester United midfielder Jesse Lingard on loan until the end of the season.