Refactor user database triggers

- Move functions creation at database level
- Add a set_triggers method to table model, use it from rake tasks
- Put varnish invalidation into a single cdb_invalidate_varnish function
  that can only be invoked by superuser (this is the only one that needs
  to be written in python)
- Make update_timestamp trigger function a security definer, so that
  it can call cdb_invalidate_varnish with controlled arguments

Run the following commands after updating:

 $ bundle exec rake cartodb:db:load_functions
 $ bundle exec rake cartodb:db:load_triggers