Split off remotejoy code into separate file