Update state listener
Add some examples
Fix state history function
Fix path to js in examples