Updated express to version 4.0 and added middleware. Update other packages to their latest versions and fixed some compatibility issues.