Fix various public API bugs, test public API methods

Back when the public API was a jQuery plugin, there were no tests for the public API methods at all, and they have since fell into disrepair.