Made appdir functions more flexible, fixed some logic in nplay client download callback