Recursively transform entities into arrays.

toArray() should recursively transform entities, otherwise you can end
up with a mixture of array's and entity objects.
Serializing an entity into JSON should call accessors.

Converting entities into JSON should call accessor methods incase they
modify on read.
Ensure that Entity::toArray() calls accessors.
Fix failing test.
Merge pull request #2360 from markstory/3.0-entity-toarray

3.0 Entity::toArray() should recurse into associated entities