Static class support (revised)

Revised version of #18 based on the comments of #19.