An axiomatic approach to gradients with applications to Dirichlet and obstacle problems beyond function spaces. (March 2016)