Small changes

Use the unittest module to run the tests if executing "python preload_test.py", and make it easier to use preload.py as a python module instead of the main python script, by adding a fetch_application(manifest_url) function.