Cleaned up the parser a bit. Additional tests added.