PageAgent: improved main-file detection + REPL fixes

Fixed the way how we detect the main application file for two cases:
  `node .` (run the local application)
  `node --debug` (start an interactive REPL session)

Fixed also other issues that prevented debugging of REPL sessions.

@Schoonology please review