Refactor the lm and glm calculations

This pull request should be coordinated with a pull request on Distributions.jl removing methods that are now defined here.

@johnmyleswhite I am submitting these changes as pull requests so that others can preview them.  You should feel free to modify the show method (e.g. printing the residual deviance) after this pull request.