Editor select + PHP API

initial patch. More to come.

Patch 2:
removed the rest of the query(), added the APIs needed and added some
documentation.

Patch 3:
removed removed_transaction restrictions pending review. Since History
needs to access the removed items, but I suspect that some errors occur in
Edit/View mode due by part of not restricting the removed transactions.
Maybe there is a solution for this, but this may be for the best for now.

Patch 4:
rebased to master

Change-Id: I1c101715c29b73d801a86fbd1f266bda2c9d7cb7