Make subcontext extraction more inteligent. Fixes #25

When generating the "last variable like part of context" known as scontext
the code was too simplistic and got confused by assignments or a parameter
list.