Fix enum.jl and convert to use immutables

It seems like `enum.jl` was broken for quite a while because `Int.nbits` is undefined. This suggests that no one is actually using it and so maybe it makes more sense to remove it than to fix it, but here's a working version that uses an immutable in place of a creating a new BitsKind.