simple history purging
replaced cloneextend with a manual solution and updated angularjs