Asyncprogress

Rebased and fixed. Replaces #175 and #181. Closes #169.
s/int/size_t/