metabase.js fixes, docs, and (the start of) tests