Exported bufferedPercent. fixes #587

Also added tests for more API methods, and moved some test helpers around to make them more accessible to other tests.