client.py: filter trailing blanks and echoed input.
added a basic test for the p(rint) command.