improve_magic_methods: refactored files + added string-like base with tests

refactored files + added string-like base with tests