Service name can only be modified if its a service

Only allow the service name to modified if the module type is a service.
Some other small code cleanup