Added refill threshold to improve download performance
Bug fixes here and there: threading improvement, command line compatibility fix, etc.