Basic parsing of integer and variable reference literals

Depends on #141 

Implements basic parsing for integer and variable reference literals
The magic constant 2 is a smell here, can what's happening here be clarified a bit?