Update utils.q

added ewma, refactored identity matrix generation, and added diagonal retrieval function