New feature: billing

Please check the code and pull into upstream. :-)