Added stack-related functions. Added a test main, not tested yet nor compiled.