If you look at my tutorial on driving a servo, you will find simple code to set and get variable values.
The current separation of variable and functions makes sense to me but it is not the only way it could be done of course. With the Javascript in the tutorial linked above, you can have your own set and get methods that emulate what you want with no trouble.