Added endswith and startswith features, general cleanup.