Do not merge - Introduce Network Policy API

Still need to add javadoc and a few tests but starting the review due to different timezones.

closes #438 


Move these two lines to the top and then put the entire above block and the `.setRequestProperty` call in a conditional around `networkPolicy != 0`.