Remove excessive file load directive
A bit of tidying up
Moved command line parsing after function declaration
Reorder imports
Get-file function and select based on command line arguments
Added description for command line documentation
determine root based on \begin{document} in file