Implement getException and clearException
Clean up javascript and remove references to deprecated functions