Added spec for empty string
Refactored stack_machine_emulator to pass the test