Use baseUrl instead of root to be able to run in subfolder

Maybe it's not everything needed to support subfolder completely but at least a part...