adding rast2text function and some preliminary tests