Handles zip and wsjar protocols properly (fixes #808)

Here is a patch for #808. Unit tests included to ensure it works properly with zip and wsjar protocols (for weblogic and websphere support, respectively)