Added BBCodes JavaScript tests, fixed a bunch of JS bugs