Added write method to FileAPI class.
Made getVariable return a variable instead of a table. Added method getTable to replace getVariable functionality.
Made getVariable a template method.
Added better error handling in case an invalid outputformat is specified.