JavaScript basic canvas framework/