Export/Init fixes

When trying to write the value of an output exported pin, I often end up with something that doesn't work.
Mostly because by the time the ready() callback is called, the direction of the pin hasn't actually been set.
We need to make sure the asynchronous calls are completed before calling the ready() callback.