Fix some bad lua api usage, and add an eclipse project for debugging.