Adding support for store_const, various bug fixes and fleshing out the tests.