Added a runtime function to get platform info.

Also added tests.