Add withdraw functionality to client and testlib

Manual testing is failing