West Ham claimed three crucial Premier League points as Kevin Nolan scored twice in a 2-0 home win over Swansea.