Added static methods to class macro

Implemented the static keyword for class macros.
To remove too much repetition I've refactored the method cases to its own macro.