Sobolev and bounded variation functions on metric measure spaces