Some graphite func definitions

Add support for some graphite funcs I've using currently. substr is not very pretty though.