Don't allow "$this" as function return type

Closes #19
Merge branch 'master' into in-portal