Add ast.parse wrapper for convenience

This wrapper adds the parent and sibling references automatically
after running a normal ast.parse. It should be used in place of
ast.parse in all locations.

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Add copy_location wrapper to references

This replicates the behaviour of ast.copy_location while also
adding sibling and parent references.

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Change modules to contain package reference

This change ensures that all Module objects passed around have a
valid Package reference even when they are not part of a package.
The goal is to standardize on having the Package attached to
simplify the branching logic that would have been required to
implement certain features. Ex: if module.package is not None...

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Add test for copy_location

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Add asttool module for import helpers

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Add asttool module for scope helpers

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Change constants optimizer to use scope helpers

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Add reminder to use scope helper in module.py

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Add inliner test for closed values in functions

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Fix style errors

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Fix py6 syntax error in test

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>
Merge pull request #6 from kevinconway/scope

Add scoping rules for constant inlining