Fixed bug in getValue that would try and do a .get on an undefined.

If lastDefined can't find a last defined model in the collection it will do a
pop() on an empty array returning 'undefined' this means we need to test that we
have a valid model before doing anything with it. if we don't we should call
formatValue with null (to get no data)

Added tests for this use case.