General cleanup (typedefs, inline, constness)