Functions and methods now use the same decorator.
Lots of documentation and simplification of code.