Add proper docstring.
Add proper tests to importstring.
Restructure code to avoid unnecessary list slicing by using rsplit.