That's great; thanks! I should have used a different example than the step function, because it was really just there because it was the easiest example I could think of, not because that's the desired function.
The function documentation you pointed out and subclassing method should work great, however.
adding functions to context
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day