Fixes #121 - Rewrite the test suite for portal.js