Fix bucket type attr in JS object

Changing from type to bucket_type and ensuring serialization round trip
is included in the unit test.
There is a bucket type cleanup item to make sure we don't use the word
type as a property of an object, but bucket_type instead. This does that
for the JS objects used in MR.