Added separate function to spawn emulator

Added a separate function to spawn the emulator and save PID to a file
on the system which will be used in the future.