[WIP] General API

This is a first attempt to implement the ideas in https://github.com/JuliaStats/RegERMs.jl/issues/3. 

*Current issue*: types and functions for losses (see, e.g., loss.jl; other files are only adapted for testing).

Next steps: tbd
The computation of objective and gradient should be fused to be more efficient. Please refer to the examples ``tloss_and_gradient`` in the discussion, which shows how you may implement the entire computation without creating a single temporary array within each iteration.