Update accessor.js

Added support for functions.