code cleanup
the client download now expects a buffer.
fix some tests.
client now downloads large files properly
fixed test case