Only turn member variables into getters/setters if type assertions on

fixes #1530

Generating getters and setters is a way to add assertions on the return
type and argument.
However getters and setters are generally slower (V8 expected) then they
are only generated when required (type assertions on).