Validate notification rules

There's the data validation, some refactoring of api.rb's internals to pass back error messages properly in the response, and specs for the notification rule object.

We probably need to talk some about the time restrictions validation, it's imperfect but better than nothing :).

Fixes #146.