initial, fairly abominable implementation of integer powers (doesn't really agree with the type system)