Clean up newnotif code, cast things from ajax return