Some infrastructure for #15. Not tested yet, needs integrating with FORTRAN bindings once they are added. May be done before this is added to master so I can use them