Sounds like some exciting changes are coming in 2.54 that will make everyone's lives easier.
Code as it is doesn't compile, copied from the link you left. Not sure if its a version thing or a syntax thing. Made an attempt to fix it and ran into more errors. Seems to be syntax.