moved LossFunctions to separate module, rewritten tests for ugb.