Move computation of tree size/offset into tree constructor
Add unit test for stack

- Also, fix bug where trees pushed onto the stack were not retained
Move lr_parser implementation into a separate .c file