Changed functions to be declared in the stage before the stage of their
declared variable.
Added test case too.
God damn .pyc files.
Self-review.