Rewrite of the /indexer endpoint.

Mainly to allow data formatted other than multipart/form-data.
The rewrite however touches a lot of the code that parses files,
even though it is kind of off-topic.