streamline fetch_data

moved repeated actions into function
added cache for nuclib

nuclib cache now generated if it doesn’t exist. and used in subsequent
calls.