Refactor text parsing

Refactored text parsing, support files & strings