Merge pull request #48 from alphagov/version-bump

Bump version to 0.3.0
Refactor predicates to be self evaluating

Moves towards not needing an Evaluator class while moving the responsibility of how to
resolve a predicate into the predicate itself
Convert evaluator tests into predicate tests

Predicates responsible for evaluating themselves, the tests should be against the models
Remove predicate evaluator entirely

- All tests
- Any use by engine, transition
- The class itself

Any place it would have been used can call evaluate on the predicate, and pass state
Let predicates self describe in a human form

Useful for debugging, and can be used in graph visualisations.

Currently graph visualisation has to know about each predicate
and it's internal implementation, this puts that repsonsibility
into the predicate itself
Merge pull request #51 from alphagov/self-evaluating-predicates

Rather than having a single Evaluator, that acts on different predicate types, move the logic of evaluation into each predicate itself, and allow them to recursively resolve.
Merge pull request #52 from alphagov/human_predicate_models

Let predicates self describe in a human form
Add function 'predicate'

This is a bit of a stretch of 'predicate', as they should be boolean, but that is
the naming convention everything else uses at the moment, so stay consistent.

- Parsing rules for a function predicate that looks like `function_name(arg_1, arg_2)`
- Transform to a Function model, which can evaluate the function and return it's result.
- The `with_eval` is a hack to get around State auto-calling any callable object, as its
  fetched from state. Changing that behaviour affects a lot of things, and I want to keep
  this commit small, so with_eval is a briding solutuin to get this working first. It
  should be removed shortly.
- It's assumed functions will be defined on state, either as a built-in, or
  injected by an external application when the flow is created.
allow nested function calls, by treating evaluatables differently from state calls
(Very WIP, do not merge) Stop evaluating callable objects returned by state

Not auto-calling callables returned from state lets us get back plugin/function
values from state and let them be called by Function, with it's own choice of
arguments.

This seems to be tightly bound with the engine internals (especiall tests).

This commit makes all the tests pass, with auto-call removed, but may not
cover all cases if test coverage is missing. I don't fully grok whats going
on here, and the eval-if-possible in Named predicate fixes some things but
is affecting a lot more than planned.