Add generic platform code and platform abstraction