Create a debug key

This patch adds a ‘Debug’ property to ‘PlayerConfig.Controls’.  By
default we bind the key to the back-tick.  We also update the input
module to set a property in the global ‘Input’ table indicating when
the user presses the key.  However, we currently take no action on a
debug key press.
Clarify the definition of ‘Sections’ in the Config module

This provides an example in the main comment block showing an example
of the format for section definitions in the configuration file.
Toggle the state of ‘Input.debugPressed’ when handling key input

The debug mode is something we will want to turn on and off, and to
that end it will be annoying if we have to constantly hold down the
debug key while trying to enter other commands.  So this patch
provides a new function called toggleKey(), local to the ‘input’
module, which toggles the state of a given key name.
Print a message to console when we enable debug mode

This is for debugging purposes to help ensure that the input code is
properly toggling the debug mode.  Currently it is not working as
expecting.  Pressing the debug key has no effect.
Add the utility function table.dump()

This will print() a table to the console similar to the way print_r()
works in PHP.  The code is a modified version of a function written by
Richard Warburton.
Fix the require() in conf.lua

After the new directory restructuring we need to use
require("src/settings") now.  With this patch the ‘config’ module
properly recognizes the newly introduced debug key.
Fixed some code and asset paths
Allow punctuation characters in configuration property values

This makes it possible to define key bindings to punctuation characters.
Config: Only allow letters for sections and property names

Because we translate these directly to table properties we want to
restrict the valid characters for identifiers to letters only.  This
simplifies things and prevents users from creating sections like
‘666HahaAnnoyingToAccess’.
Do not toggle debug mode when releasing the debug key

This creates the same effect we wanted to avoid in the first place:
having to hold down the debug key in order to be in debug mode.  With
this patch in place we can start a new game and press the debug key to
see a continuous stream of messages saying debug mode is enabled until
we toggle it off.
Fix table.dump() using the wrong iterator

I accidentally used ipairs() when I should use pairs().  Now
table.dump() creates actual output.
Improve the readability of table.dump() output
Do not update ‘currentScene’ when in debug mode

We will want to take our time when entering debug commands.  So to
help with that we modify love.update() to not update the current scene
when we are in debug mode.  Certain things like animations and music
will still play, but this will have the effect of stopping player
input and other gameplay effects.
Create a ‘debug’ module that exports a Debug class

The singleton (gasp) Debug class will provide our debugging
functionality.  Currently the patch only implements one method, which
is to tell us whether or not we have enabled debugging by checking the
status of ‘Input.debugpPressed’.
Make love.update() test Debug:isEnabled() instead of debugPressed

This is a step towards encapsulating the debugging functionality.
Create the ‘assets’ module with a basic Assets object

This patch adds a globally accessible ‘Assets’ object to the system.
The purpose of this is to store references of assets we load so that
we can make them globally accessible to other parts of the game
engine, particularly the debugging code.  Right now ‘Assets’ is just
an array with one method for adding shallow copies of objects to the
collection; the method checks for the existence of the object first
before adding it.  Treating ‘Assets’ as a hash would allow for faster
lookups but we need a standard way of creating a key from objects.
Change the global collection of assets to be a hash

This changes our global ‘Assets’ object to be a hash that maps
filepaths to objects that represent the contents of those files.  This
will make it easier to lookup assets and to issue debugging commands
to reload certain assets based on filenames.
Fix the require() paths in the ‘bee’ module
Avoid infinite recursion in table.dump()

If we call table.dump() on a table with a cyclical reference then the
function will never return and lock up the program.  This patch
restructures the function to keep a tab on which properties we have
seen.  If we come across a property with the same name then we ignore
it, thus avoiding getting stuck in any loops.
Store the hash of assets in a separate property

This patch adds a method called printFilepaths() which will print the
names of all the files stored in the Assets object.  But in order to
avoid printing out other information like method names we need to
store hash of files to objects in a separate property.  If
printFilepaths() were to simply loop over ‘pairs(self)’ then we would
print out method names, ‘__index’, and other table information besides
the file names.  Adding the property ‘files’ helps us avoid this.

We updated the method add() accordingly to store information in this
new property.