Artin stacks, constructible functions and motivic invariants