adding security features for reading files for #24
call get_file from to_python, reducing code copy/paste for #23
minor typos leftover from moving code
Merge pull request #26 from btbonval/master

Security features closes #24 and deduplication closes #23