Refactored to simplify baton-get read loop.

Added functions to specify a local directory and file in baton JSON.