fixed rspec test so that it breaks BSON serialization
fixed tests on code with scope to reveal bug
added changes to fix bug in code with scope
cleaned up changes, made it so that code with scope serializing uses esisting methods in encodable.rb
Refactor CodeWithScope.from_bson