Convert repl_ex.c to C++

Moved matching header to start, eliminated unused variables, fixed
int64 format string, eliminated an unnecessary header.

Change-Id: I6985a41279c0be6e3c0c468a921dfe50a87bed4f