* Add function that checks whether a file is a terminal device.
* support isTTY function for NodeJS backend.
* don't accidentally interpret 'false' string as truthy number
* less code duplication.
Pragma once is supported by all compilers for the last ten years.
Better use it instead of include guards (which use different styles
in different files).