rudimentary support for include directives, and some bugfixes