Add system.api integration tests
Add polyfil for Promise. Fix minor issue with test structure