Fixed bug for inserting rules via API

Previously, if you inserted multiple rules in a single string
via the API, we did not catch the error.  Instead, we simply
processed the first rule.  One symptom of this problem
is an internal server error when someone uses a minus sign
in the middle of a table name, e.g. router-name(x) :- ...
Because of the grammar, this rule would be parsed as two
separate rules: router-() and name(x) :- ...

This change checks that the number of rules sent into
the API is always 1 and shows you the list of rules that
you submitted in the error message.  This helps the user
debug the problem.

Perhaps the grammar should be changed as well, but this
fix is necessary in either case.

Closes-bug: 1367887
Change-Id: I7efec72ef96d6958c1af227d3ef8fb0707703f3b
Merge "Fixed bug for inserting rules via API"