software/theia: Select free ports automatically

Changes:
- Add comments and reorganise instance.cfg.in for clarity
- Select free ports instead of hardcoded ports
- Upgrade to slapos.core 1.6.5 to prefix forwarded requests

This makes it possible to recursively nest theias into theias.

See merge request !919
2 jobs for master
in 0 seconds, using 0 compute credits, and was queued for 0 seconds