Updated import parsing logic and added tests