Feature/space-optimize

Here's some safe optimizations - mostly code inlining. When the function body inlined is less than the function call overhead, we save space. Also, even if the body is larger initially, it can become smaller after optimization, since the compiler has more context to work with.