Some refactoring of base functionality.
Documentation updates.
Added empty() function to JSON.