HTML: Refactorings to remote download feature

Based on feedback from @SLaks