replaced if-thens with string capture
start simplify next_test (removed 1 if-then level, causing lots of whitespace changes)
renamed local variable, make code easier to read. Added some comments.
fix documentation error
made index keeper a table entry to prevent such a 'global' upvalue to be accidentally changed
added couple TODOs
some refactoring in commandline tests
added some failing tests, commented out, marked with TODO comments
added lineend
Merge pull request #170 from Tieske/cleanup

Cleanup and refactoring