Add getLineTokens method
Clean up getLineTokens, add test

Issue #2908