Implements switch, extension and light source functions

- Switch function implemented.
- Light source function implemented.
- Extension function implemented.