remote: added option to run in foreground
remote: updated self tests for new remote functionality (unfinished)