Handle dotless commands in the REPL.

Node 0.11 switched to storing the REPL commands dotless internally.
This fixes the problem brought up in #3450.
Implement changes recommended in the pull request.
Make getCommandId() more readable.
Merge pull request #3503 from datenreisender/handle-dotless-commands

Handle dotless commands in the REPL.