Many changes to core and examples