Modified "historicState" to return HistoricItem as per other extensions

Updated historicState to return HistoricItem rather than State. This beings the historicState persistence extension in line with the other extensions (therefore now requiring .state to access the state in the rule).

changedSince is also modified as it called historicState internally
test methods also updated.

I've tested this with a basic rule, but my rule skills are limited so you might want to double check :)

(I'm not sure why the diff here is showing the whole file has changed!).