Add pqxx magic to allow use of arrays

This magic allows the use of bigint[] arrays. See https://github.com/zerebubuth/openstreetmap-cgimap/issues/58#issuecomment-24663264
Add a new function for inserting results into a list in the readonly backend

This also allows us to replace insert_results_of with a call to
insert_results

Eventually we want to rewrite everything to use insert_results, but
this allows it to be done incrementally.
Convert select elements from lists to prepared statements for readonly