Moved platform related code from Environment to the platform module

Replaced Environment's methods with code executed at module import
because that shouldn't change during execution of ipkg ; no reason to
execute this code several time by calling functions