Tidy up internals and add isRefreshing() and setRefreshing() methods.

Fixes #3 and #4.