Adding some more functions

using logic from https://github.com/brutasse/graphite-api.
With some refactoring so I won't contribute too much to #17.