Cleans-up htmlCanvas + adds support for function attributes