Cleaned up the chatviewmodel javascript.