Add docdir, mandir and man1dir environment variables for make install

Also change the default path for documentation to something more standard.
Copy doc/ and examples/ under $(build_docdir) instead of creating symlinks
as before, so that we don't need to remove unwanted files afterwards.
Finally, fix code relying on old paths.