Implement INQUIRE

Implement INQUIRE, more code refactoring as a result and now passing
four more I/O tests. Still two COMMON unit tests failing due to unit
test limitations.