Moved some imports to the bottom in __init__.py files

This should make the functions defined inside the __init__.py files accessible
by the sub-modules they're trying to import.
Refactored the way functions are handled.

The solving algorithm is simplified a bit by looking at the index numbering
rather than dictionary keys. The actual functions have a lot less code
repetition now because they now simply stuff everything in tuples and hand
the data over.
Added back docstring to get_results()
Merge pull request #13 from Rubykuby/refactor

Refactor function handling