Hold onto your hats; lots of updates.

Updates to Colony class:
1) Added a can_afford function which should be called before calling subtract_resources in most cases.
2) Removed the automatic save-to-database functionality when adding or subtracting resources. Call save_data when needed.
3) Removed the database's ugly resource-tracking fields from instances.
4) Fixed save_data method.

Updates to contents/command_center.php
1) Updated colony_management screen to include an upgrade button for each building.
2) Added function named upgrade_building.

Added an AJAX script named upgrade_building to handle building upgrades. The only thing it doesn't do yet is: inserting a new upgrade job to the job-queue in the database.

Added "warnings" in addition to already existent "errors" for scripts that return JSON. "warnings" are handled by the on-success callback function, whereas errors are handled in javascript/lib.js by the request_error_handler function.

Added a begin_upgrade method to the Colony_Building class that should be implemented by all extending classes.

In classes/Database_Row.php, I changed the Database_Row's save_data method so that it does not accidentally change the data-row's id field, which should always be the same.

Fixed a bug in the constructor of all colony building classes (children of Colony_Building).
Converted from using tiles and tile_ids to using x and y coordinates everywhere. Any object that used to have a tile_id field now has both an x_coord and a y_coord field.
Merge branch 'master' of https://github.com/allencct/Dvorak