Replace rules by INSTEAD OF trigger and upsert
Replace rules by INSTEAD OF trigger and upsert

Credit for the upsert function goes to Sebastian Schrader.

Fixes #149

agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft