Subdirs

Fixes problems with sub-directories, also generates proper HTML output in ``target``.