Added Text() function

Added Text() function that returns text contents.
Also refactored the extensions and unit tests in a better file separated
way.