Added write function to our mochad driver implementation.