Backend: Limit input

The arbitrary precision algorithms are quite slow. A limit
of 1000 digits must be enforced to not completely choke the
server.