Added a test function and generalized the model

Rather than passing a string to match lm or glm just pass the model as
a function handle and use ellipsis to provide additional arguments.

Also converted selection() to use named lists so we don't have ambiguous
indexing withing select().