refactor to unify file and URL checking
file loading is now asynchronous as well
fix synchronous file checking